<h1><?php echo CrugeTranslator::t('logon', "Login"); ?></h1>
<?php if (Yii::app()->user->hasFlash('loginflash')): ?>
    <div class="flash-error">
        <?php echo Yii::app()->user->getFlash('loginflash'); ?>
    </div>
<?php else: ?>
    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'logon-form',
        'enableClientValidation' => false,
        'clientOptions' => array(
            'validateOnSubmit' => true,
        ),
        'htmlOptions' => array('role' => 'form')
    ));
    ?>
    <div class="input-group">
        <span class="input-group-addon"><i class="fa fa-user"></i></span>
        <?php echo $form->textField($model, 'username', array('class' => 'form-control', 'placeholder' => 'Usuario')); ?>
    </div>
    <?php echo $form->error($model, 'username'); ?>
    <div class="input-group">
        <span class="input-group-addon"><i class="fa fa-key"></i></span>
        <?php echo $form->passwordField($model, 'password', array('class' => 'form-control', 'placeholder' => 'Contraseña')); ?>
    </div>
    <?php echo $form->error($model, 'password'); ?>
    <div id="remember-me-wrapper">
        <div class="row">
            <div class="col-xs-10">
                <div class="checkbox-nice">
                    <?php echo $form->checkBox($model, 'rememberMe'); ?>
                    <?php echo $form->label($model, 'rememberMe'); ?>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12">
            <button type="submit" class="btn btn-success col-xs-12">Iniciar Seción</button>
            <?php // Yii::app()->user->ui->tbutton(CrugeTranslator::t('logon', "Login"), array('class' => 'btn btn-success col-xs-12')); ?>
        </div>
    </div>
    <?php $this->endWidget(); ?>
    </div>
<?php endif; ?>
